<?php

namespace app\backend\validate;

use think\Validate;

class OrderValidate extends Validate
{
    protected $rule = [
        'page' => 'integer',
        'limit' => 'integer',
        'id' => 'require|integer',
        'kong_type' => 'require|in:0,1,2',
    ];

    protected $message = [
        'page.integer' => '页码格式错误',
        'limit.integer' => '条数格式错误',
        'id.require' => 'ID不能为空',
        'id.integer' => 'ID格式错误',
        'kong_type.require' => '控制盈亏不能为空',
        'kong_type.in' => '控制盈亏参数错误',
    ];

    protected $scene = [
        'index' => ['page','limit'],
        'history' => ['page','limit'],
        'editKongType' => ['id','kong_type']
    ];
}
